/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jl.tools.stkeditor.generate;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.jl.tools.stkeditor.exception.DataNotMatchCodingScheamException;
import com.jl.util.HexUtil;

public final class OriginalCode implements Code{

  
  private final String data;
  public OriginalCode(String data){
    this.data = HexUtil.format(data.trim());
  }
  
  public OriginalCode(String data,String tag){
    this.data = data.trim();
  }
  
  @Override
  public List<String> getCode() throws DataNotMatchCodingScheamException {
    List<String> l = new ArrayList<String>();
    l.addAll(Arrays.asList(data.split(" +")));
    return l;
  }

  @Override
  public int getLength() {
    return data.split(" +").length;
  }
  
}
